﻿@model Dal.Entities.User
@{
    Layout = null;
    ViewBag.Nav = 7;
    int ti = 1;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>医生/医院信息编辑</title>
    @Html.Partial("meta")
</head>
<body id="b_main">
    @Html.Partial("header")
    <!--/end #header-->
    <div id="wrapper">
        <!--holds pretty much everything-->
        @Html.Action("index", "news")
        <!--/end #menu_main-->
        <div id="content">
            @Html.Partial("nav")
            @using (Html.BeginForm("", "userinfo", FormMethod.Post, new { @class = "broom_form", id = "form1", style = "margin-left: 30px;" }))
            {
                @Html.HiddenFor(i => i.ID)
                if (ViewBag.Result != null)
                {
                    if (ViewBag.Result == true)
                    {
                <div class="notification confirm">
                    <em>
                        <img src="/assets/img/icons/tick_circle.png" alt="" />操作成功 </em>
                </div>
                    }
                }
                <table cellspacing="0" summary="table" class="broom_table" width="90%">
                    <tbody>
                        <tr class="@(ti % 2 == 1 ? "odd" : "even")">
                            <td>
                                @(ti++)
                            </td>
                            <td>
                                <span>省 份</span> <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.DropDownListFor(i => i.ProvinceID, null, new { @class = "select", onchange = "selectCity()" })
                                <script type="text/javascript">
                                    function selectCity() {
                                        $.getJSON('region?id=' + $("#ProvinceID").val(), function (data) {
                                            var items = [];
                                            items.push('<option value="-1">请选择</option>');
                                            $.each(data, function (key, val) {
                                                items.push('<option value="' + val.Id + '">' + val.BriefName + '</option>');
                                            });
                                            $("#CityID").html(items.join(''));
                                        });
                                    }
                                </script>
                            </td>
                        </tr>
                        <tr class="@(ti % 2 == 1 ? "odd" : "even")">
                            <td>
                                @(ti++)
                            </td>
                            <td>
                                城 市 <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.DropDownListFor(i => i.CityID, null, new { @class = "select" })
                            </td>
                        </tr>
                        <tr class="@(ti % 2 == 1 ? "odd" : "even")">
                            <td>
                                @(ti++)
                            </td>
                            <td>
                                医院名称 <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.TextBoxFor(i => i.HospitalName, new { @class = "inputbox" })
                            </td>
                        </tr>
                        <tr class="@(ti % 2 == 1 ? "odd" : "even")">
                            <td>
                                @(ti++)
                            </td>
                            <td>
                                医生姓名 <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.TextBoxFor(i => i.DoctorName, new { @class = "inputbox" })
                            </td>
                        </tr>
                        <tr class="@(ti % 2 == 1 ? "odd" : "even")">
                            <td>
                                @(ti++)
                            </td>
                            <td>
                                医生手机 <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.TextBoxFor(i => i.DoctorMobile, new { @class = "inputbox" })
                            </td>
                        </tr>
                        <tr class="@(ti % 2 == 1 ? "odd" : "even")">
                            <td>
                                @(ti++)
                            </td>
                            <td>
                                科 室 <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.RadioButtonFor(i => i.SubjectName, "精神科", new { onclick = "hide('divrdSubjectNameOther')" })
                                精神科<br />
                                @Html.RadioButtonFor(i => i.SubjectName, "心理科", new { onclick = "hide('divrdSubjectNameOther')" })
                                心理科<br />
                                @Html.RadioButtonFor(i => i.SubjectName, "神经内科", new { onclick = "hide('divrdSubjectNameOther')" })
                                神经内科<br />
                                @Html.RadioButtonFor(i => i.SubjectName, "其它", new { onclick = "show('divrdSubjectNameOther')", id = "rdSubjectNameOther" })
                                其它
                                <div id="divrdSubjectNameOther" style="padding-left: 30px">
                                    请填写： @Html.TextBoxFor(i => i.AdditionSubjectName)
                                </div>
                                <script type="text/javascript">
                                    associate('rdSubjectNameOther', 'divrdSubjectNameOther');
                                </script>
                            </td>
                        </tr>
                        <tr class="@(ti % 2 == 1 ? "odd" : "even")">
                            <td>
                                @(ti++)
                            </td>
                            <td>
                                职 称 <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.RadioButtonFor(i => i.TitleName, "主任医师", new { onclick = "hide('divrdTitleNameOther')" })
                                主任医师<br />
                                @Html.RadioButtonFor(i => i.TitleName, "副主任医师", new { onclick = "hide('divrdTitleNameOther')" })
                                副主任医师<br />
                                @Html.RadioButtonFor(i => i.TitleName, "主治医师", new { onclick = "hide('divrdTitleNameOther')" })
                                主治医师<br />
                                @Html.RadioButtonFor(i => i.TitleName, " 其它", new { onclick = "show('divrdTitleNameOther')", id = "rdTitleNameOther" })
                                其它
                                <div id="divrdTitleNameOther" style="padding-left: 30px">
                                    请填写： @Html.TextBoxFor(i => i.AdditionTitleName)
                                </div>
                                <script type="text/javascript">
                                    associate('rdTitleNameOther', 'divrdTitleNameOther');
                                </script>
                            </td>
                        </tr>
                        <tr class="@(ti % 2 == 1 ? "odd" : "even")">
                            <td>
                                @(ti++)
                            </td>
                            <td>
                                目前您门诊平均每周病人总数 <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.TextBoxFor(i => i.PatientCount, new { @class = "inputbox" })
                            </td>
                        </tr>
                        <tr class="@(ti % 2 == 1 ? "odd" : "even")">
                            <td>
                                @(ti++)
                            </td>
                            <td>
                                其中抑郁焦虑病人每周总数 <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.TextBoxFor(i => i.PatientYiYuCount, new { @class = "inputbox" })
                            </td>
                        </tr>
                    </tbody>
                </table>
                if (ViewBag.CannotModify != null && ViewBag.CannotModify)
                {
                <div class="notification confirm">
                    <em>
                        <img src="/assets/img/icons/tick_circle.png" alt="" />医生信息一经录入禁止修改</em>
                </div>
                }
                else
                {
                <div class="button">
                    <div class="btn-inner">
                        <span><em>
                            <button type="submit" name="buttonsave">
                                <img src="/assets/img/icons/disk_black.png" alt="" />保存数据</button>
                        </em></span>
                    </div>
                </div>
                }
            }
            <!--/end .tabber-->
        </div>
    </div>
    <div class="clear">
    </div>
    @Html.Partial("questionScript")
    <script type="text/javascript">
        $(document).ready(function () {
            $("#form1").validate({
                rules: {
                    HospitalName: "required",
                    DoctorName: { required: true, maxlength: 6 },
                    DoctorMobile: { required: true, isPhone: true },
                    SubjectName: { required: true },
                    TitleName: { required: true },
                    PatientCount: { required: true, digits: true },
                    PatientYiYuCount: { required: true, digits: true },
                    ProvinceID: { required: true, min: 1 },
                    CityID: { required: true, min: 1 }
                },
                messages: {
                    HospitalName: "医院名称不能为空",
                    DoctorName: { required: "医生姓名不能为空", maxlength: "姓名太长" },
                    DoctorMobile: { required: "请填写联系电话", isPhone: "请正确填写电话号码" },
                    ProvinceID: { required: "省份为必填项", min: "请选择您所处的省份" },
                    CityID: { required: "城市为必填项", min: "请选择您所处的城市" }
                }
            })
        });
    </script>
</body>
</html>
